package com.bjtu.restaurantreviews.dao;

import com.bjtu.restaurantreviews.domain.Track;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;


import javax.transaction.Transactional;

public interface TrackRepository extends JpaRepository<Track,Integer> {
    @Transactional
    @Query(value = "update track t set t.tnum=t.tnum+1 where t.tuid=?1 and t.trid=?2",nativeQuery = true)
    @Modifying
    public void update(Integer tuid,Integer trid);
}
